<?php
require_once "../database/mysql.class.php";
//DAO对象，对数据库操作
//对应用户表，用户的增删改查

class dingdangdao{

	private $db;

	public function __construct(){
		$this->db=new mysql();
	}
	
public function Chaxun($select=null){	
		if (!isset($select)){
			$sql="select * from dingdang order by time DESC;";
			return $this->db->query($sql);
		}
		else if (isset($select)){
			//echo $select;
			$sql="select *  from dingdang  where type='".$select."' order by time DESC;";
		    return $this->db->query($sql);
		}
		else {
			
		}
	}
	//删除骑士
	public function Del($delid){
		if (isset($delid)){
			//echo($delid);
			$sql=" DELETE FROM dingdang WHERE id=".$delid.";";
			return $this->db->delete($sql);
			header("location:../view/main.php?url=dingdangamer.php");
		}
	}
	
}





?>